package org.example.zpqy.controll;

import org.example.zpqy.service.AppleAiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/ai")
public class AppleAiController {

    @Autowired
    private AppleAiService appleAiService;

    @GetMapping("/advice")
    public List<Map<String, String>> getAdvice(@RequestParam String cropName, @RequestParam String cityCode) {
        return appleAiService.getAiAdvice(cropName, cityCode);
    }
}
